/**
 * User class
 */
package edu.gatech.userclasses;

import java.io.Serializable;

/**
 * Basic user class that other user classes will be based on.
 * @author Dan Holdridge
 * @version 1.0
 *
 */
public class User implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5885115107092202L;

	/**
	 * Boolean value determines if the user should be able ot login
	 */
	protected boolean isSuspended = false;
	
	/**
	 * String name of the user
	 */
	protected String name;
	
	/**
	 * String name of the useruser
	 */
	protected String username;
	
	/**
	 * String containing the password
	 */
	protected String password;
	
	/**String containing address**/
	protected String address;
	
	/**String containing phone number**/
	protected String phoneNumber;
	
	/**
	 * String the type of user, ie Patient, Doctor, etc.
	 */
	protected String userType = "User";
	
	/**
	 * Creates a new User with the given name
	 * @param name The name of the user
	 */
	protected User(String name) {
		this.name = name;
	}
	
	/**
	 * Default constructor gives the User a default name
	 */
	protected User() {
		this("John Doe");
		
	}
		
	/** Resolves the class as a String containing the user's name
	 * @return The name of the user
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return userType + " " + name;
	}

	/**
	 * (non-Javadoc)
	 * @param o The object to compare to <code>this</code>
	 * @return True if both objects equal
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o){ // $codepro.audit.disable com.instantiations.assist.eclipse.analysis.audit.rule.effectivejava.obeyEqualsContract.obeyGeneralContractOfEquals, overridingEqualsAndHashCode
		if (! (o instanceof User)){
			return false;
		}
		final User newUser = (User) o;
		return (username.equals(newUser.getUsername()) && 
				password.equals(newUser.getPassword()));
		
	}

	/**
	 * @return the isSuspended
	 */
	public boolean isSuspended() {
		return isSuspended;
	}

	/**
	 * @param isSuspended the isSuspended to set
	 */
	public void setSuspended(boolean isSuspended) {
		this.isSuspended = isSuspended;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setusername(String username) {
		this.username = username;
	}
	
	/**
	 * @return String password
	 */
	public String getPassword(){
		return password;
	}
	
	/**
	 * @param password to set
	 */
	public void setPassword(String password){
		this.password = password;
	}

	/**
	 * @return the userType
	 */
	public String getUserType() {
		return userType;
	}

	/**
	 * @param userType the userType to set
	 */
	public void setUserType(String userType) {
		this.userType = userType;
	}
	
	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}
	
	/**
	 * @param address String with address
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * @return phone number
	 */
	public String getPhoneNumber() {
		return phoneNumber;
	}
	
	/**
	 * @param phoneNumber String with phone Number
	 */
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	

}
